<?php
define('LEGAL_OPER', true);
require('../includes/captcha/CaptchaUtil.class.php');
require('../includes/lib_main.php');

$p = to_int($_GET['p']);
if($p > 0){
	$captchaUtil = new CaptchaUtil();
	$captch = $captchaUtil->getCaptcha();
	$captch = strtolower($captch);
	session_start();
	if($p == 1){
		$_SESSION['login_captcha'] = $captch;
	}else if($p == 2){
		$_SESSION['register_captcha'] = $captch;
	}
	$captchaUtil->writeImage();
}
exit;








